/**
 * 迭代器模块
 * License: BSD
 * Authors: Lucifer (786325481@QQ.com)
 * Copyright: Copyright (C) 2008 Lucifer. All rights reserved.
 */
module system.collections.IEnumerator;

/**
 * Base interface for all generic iterator.
 * This interface provides a simple approach to iterating over a collection.
 */
public interface IEnumerator(T)
{
    /**
     * Advances the iterator to the next element of a collection.
     * Returns: a boolean indicating whether an element is available.
     * Upon creation, an iterator is conceptually positioned before the first
     * element of the enumeration, and the first call to moveNext()
     * brings the first element of the iterator into view.
     */
    bool moveNext();
    /**
     * Returns: the current element of the iteration.
     * The returned value is undefined before the first call to moveNext()
     * and following a call to moveNext() that returned false.
     * Multiple calls to current with no intervening calls to moveNext()
     * will return the same object.
     */
    T current();
    /**
     * Resets the iterator to the beginning of the iteration, starting over.
     */
    void reset();
}
